package edu.scau.comeva.rigcontrol.model;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * User: Dan
 * Date: 13-8-15
 * Time: 下午11:21
 * To change this template use File | Settings | File Templates.
 */
@Table
@Entity
public class m_resource implements Serializable {
    private long res_id;
    private String res_name;
    private m_right res_right;
    private long res_parent_id;

    @Id
    @GeneratedValue
    public long getRes_id() {
        return res_id;
    }

    public void setRes_id(long res_id) {
        this.res_id = res_id;
    }

    public String getRes_name() {
        return res_name;
    }

    public void setRes_name(String res_name) {
        this.res_name = res_name;
    }

    @ManyToOne
    @JoinTable(
            name = "m_resource_right",
            joinColumns = @JoinColumn(name = "fk_resource_id",referencedColumnName = "res_id"),
            inverseJoinColumns = @JoinColumn(name = "fk_right_id",referencedColumnName = "rig_id")
    )
    public m_right getRes_right() {
        return res_right;
    }

    public void setRes_right(m_right res_right) {
        this.res_right = res_right;
    }

    public long getRes_parent_id() {
        return res_parent_id;
    }

    public void setRes_parent_id(long res_parent_id) {
        this.res_parent_id = res_parent_id;
    }
}
